Repository navigation
Conversation
The media query used an ioctl code that does not exist, so it always failed and a locked SD card counted as writable. The code now comes from windows-sys and the replies are parsed byte by byte.
🧪 Test BuildsVersion:
How to run these test buildsmacOS (Apple Silicon): xattr -dr com.apple.quarantine /Applications/Armbian\ Imager.appWindows: Linux: chmod +x ./*.AppImage && ./*.AppImage
# or
sudo apt install ./*.debUpdates are disabled in these test builds. Artifacts expire in 14 days. |
|
@shvmm could you kindly test one more thing with your card reader? This PR should make a write-protected SD card show as Locked on Windows. Using the Windows build from the test builds comment above, insert the card with the lock switch off (it should be selectable), then slide the switch on and reinsert it (it should now show as Locked); there is no need to flash anything. If it doesn't show as Locked, please upload the log from the app and paste the link here. |
it says read_only=false even when I slide the lock card tab and reinsert. EDIT: Tested the same SD adapter on Linux and it correctly shows (ro) flag in dmesg. https://paste.armbian.com/ujikawuragumokil Also can the main flashing and verifying interfaces could expose more details during the operations. Like speed in MB/s, current filename, files count. (maybe hide them under a collapsible arrow) |
|
@shvmm thanks, that answers it. Your log shows Windows reporting the card as writable with the switch on ( |
|
Don't have an external USB Card reader. But I've a camera that exposes itself as removable disk. I should maybe check write protect there |
Description
On Windows the app never saw the lock switch on an SD card. The media query used a hand-written control code,
0x002D0030, that is not a real one (it came in with #97), so the call always failed and a failure counts as writable. A locked card was offered as a normal target and the write failed later.I now take the code from windows-sys and read the reply byte by byte instead of casting it to structs. A locked card shows as "Locked" and is refused before writing, as on Linux and macOS. A reader error still counts as writable, so it cannot block a working card.
How Has This Been Tested?
npm run lintandnpx tsc --noEmit -p tsconfig.app.jsonpasscargo fmt --check,cargo clippy --all-targets --all-features -- -D warnings(also for the Windows target) andcargo testpassChecklist: